import pytest,yagmail,os
from yuekao.log_set import log_weidu
if __name__ == '__main__':
    log_weidu()
    pytest.main(['test_xiadanyw.py', '-s', '--clean-alluredir', '--alluredir=./repor'])
    os.system('allure generate ./report -o ./htmlbg --clean')
    def send_mail(filename):
        mail=yagmail.SMTP(user="2018675435@qq.com",password="nnqakcckuzyqfebd",host="smtp.qq.com")
        mail.send(to="2018675435@qq.com",
        subject="维度电商系统接口测试报告",
        contents="请查收",attachments=filename)
        #发送
    send_mail(['weidudiansanglog.txt','./htmlbg/ceshi.html'])







